package com.yzt.loginmodule.report.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.yzt.zhuju.network.entity.sysConfig.ReportPhotoBean;
import com.yzt.loginmodule.R;
import com.yzt.plugin_imageloader.ImageLoadUtil;
import com.yzt.plugin_widget.RoundImageView;

import org.jetbrains.annotations.NotNull;

/**
 * author : bob
 * date   : 2022/12/8
 * desc   : 举报图片的适配器
 */
public class ReportPhotoAdapter extends BaseQuickAdapter<ReportPhotoBean, BaseViewHolder> {

    private int type;

    public void setType(int type) {
        this.type = type;
    }

    public ReportPhotoAdapter() {
        super(R.layout.item_report_photo);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder holder, ReportPhotoBean item) {
        RoundImageView photoIv = holder.getView(R.id.photo_riv);
        if (item.getStatus() == -1) {
            photoIv.setImageResource(R.mipmap.icon_report_photo);
        } else {
            ImageLoadUtil.loadImg(getContext(), item.getPathUrl(), photoIv);
        }
        holder.setGone(R.id.delete_iv, item.getStatus() == -1);
    }
}
